
******************************************************************************
*  						REPLICATION CODES 
*								for 
*  Belief in Territorial Indivisibility & Public Preferences for Dispute Resolution
*						Version: Feb 12, 2022
******************************************************************************

**Make sure that the raw data "japan_raw.dta" is in the same folder as the do file
**Make sure that the file "prefgeo.dta" is in the same folder as the do file

**install package "rowranks"
**ssc install rowranks

use "japan_raw.dta"


**variable construction

//socioeconomic

gen age = 2016 - b01 
label variable age "Age"

gen male = 2 - b03
label variable  male "Male"

gen edu=b06
label variable edu "Education Level"

gen edu1=0
replace edu1=1 if b06 <= 2
label variable edu1 "No College"

gen edu2=0
replace edu2=1 if b06==3 | b06==4
label variable edu2 "College Education"

gen edu3=0
replace edu3=1 if b06 > = 5
label variable edu3 "Postgraduate Education"

gen college = 0 
replace college = 1 if b06 >= 4
label variable college "College Degree"

gen fulltime = 0
replace fulltime = 1 if b07 <= 2
label variable fulltime "Full-time Job"

gen parttime = 0
replace parttime = 1 if b07 == 3 | b07 == 4
label variable parttime "Part-time Job"


gen selfemp = 0
replace selfemp = 1 if b07 == 5

gen unemp = 0
replace unemp = 1 if b07 >= 6

gen income=b09
label variable income "Income"

destring b10, gen(socialstatus)
label variable socialstatus "Social Status"

gen news = 5 - b13
label variable news "Interest in International Affairs"

destring b15x_1 b15x_2 b15x_3 b15x_4 b15x_5 b15x_6 b15x_7 , ///
gen(b15_1 b15_2 b15_3 b15_4 b15_5 b15_6 b15_7 )

rowranks b15_1 b15_2 b15_3 b15_4 b15_5 b15_6 b15_7, gen(r1-r7) highrank

gen defense=0
replace defense=1 if r2==7
gen rank_defense=r2
label variable defense "National Defense Top Issue"
label variable rank_defense "Ranking of National Defense among All Issues"

gen nationalism1 = 0
replace nationalism1 = 1 if b16_1 < 3

gen nationalism2 = 0
replace nationalism2 = 1 if b16_2 < 3

gen nationalism3 = 0
replace nationalism3 = 1 if b16_3 < 3

gen nationalism4 = 0
replace nationalism4 = 1 if b16_4 < 3

gen nationalism5 = 0
replace nationalism5 = 1 if b16_5 < 3

gen nationalism = (nationalism1 + nationalism2 + nationalism3 + nationalism4 + nationalism5) / 5 
label variable nationalism "Nationalism"

gen ldp=0
replace ldp=1 if b11==1
label variable ldp "Liberal Democratic Party"

gen noparty=0
replace noparty=1 if b11==8
label variable noparty "No Political Party"

destring b12, gen(conserv)
replace conserv = . if conserv == 11
label variable conserv "Conservatism"

**countries in mind (duplicate)
gen dup = a14x_china+a14x_russia+a14x_south	  

**Regions
ren b04 q09
destring q09, generate(q09a)
generate hokkaidotohoku=0
label var hokkaidotohoku "Hokkaido&Tohoku"
replace hokkaidotohoku=1 if q09a==01
replace hokkaidotohoku=1 if q09a==02
replace hokkaidotohoku=1 if q09a==03
replace hokkaidotohoku=1 if q09a==04
replace hokkaidotohoku=1 if q09a==05
replace hokkaidotohoku=1 if q09a==06
replace hokkaidotohoku=1 if q09a==07
generate kantokoshinetsu=0
label var kantokoshinetsu "Kanto&Koshinetsu"
replace kantokoshinetsu=1 if q09a==08
replace kantokoshinetsu=1 if q09a==09
replace kantokoshinetsu=1 if q09a==10
replace kantokoshinetsu=1 if q09a==11
replace kantokoshinetsu=1 if q09a==12
replace kantokoshinetsu=1 if q09a==13
replace kantokoshinetsu=1 if q09a==14
replace kantokoshinetsu=1 if q09a==15
replace kantokoshinetsu=1 if q09a==19
replace kantokoshinetsu=1 if q09a==20
generate chubu=0
label var chubu "Chubu"
replace chubu=1 if q09a==16
replace chubu=1 if q09a==17
replace chubu=1 if q09a==18
replace chubu=1 if q09a==21
replace chubu=1 if q09a==22
replace chubu=1 if q09a==23
replace chubu=1 if q09a==24
generate kinki=0
label var kinki "Kinki"
replace kinki=1 if q09a==25
replace kinki=1 if q09a==26
replace kinki=1 if q09a==27
replace kinki=1 if q09a==28
replace kinki=1 if q09a==29
replace kinki=1 if q09a==30
generate chugokushikoku=0
label var chugokushikoku "Chugoku&Shikoku"
replace chugokushikoku=1 if q09a==31
replace chugokushikoku=1 if q09a==32
replace chugokushikoku=1 if q09a==33
replace chugokushikoku=1 if q09a==34
replace chugokushikoku=1 if q09a==35
replace chugokushikoku=1 if q09a==36
replace chugokushikoku=1 if q09a==37
replace chugokushikoku=1 if q09a==38
replace chugokushikoku=1 if q09a==39
generate kusyuokinawa=0
label var kusyuokinawa "Kyusyu&Okinawa"
replace kusyuokinawa=1 if q09a>=40
gen region=0
label var region "Region"
replace region=1 if kantokoshinetsu==1
replace region=2 if chubu==1
replace region=3 if kinki==1
replace region=4 if chugokushikoku==1
replace region=5 if kusyuokinawa==1
label define regionlabel ///
            0 "Hokkaido&Tohoku" ///
            1 "Kanto&Koshinetsu" ///
            2 "Chubu" ///
            3 "Kinki" ///
            4 "Chugoku&Shikoku" ///
            5 "Kyusyu&Okinawa"
label values region "regionlabel"

******************************
// Geographic proximity to disputed areas

// 1: Prefecture dummies
//    Takeshima (32 Shimane prefecture)
//    Senkaku   (47 Okinawa prefecture)
//    Northern Territory (1 Hokkaido prefecture)

gen disp_proxim = (q09a == 1 | q09a == 32 | q09a == 47)

// 2: Minimum distance to disputed areas
//    See geodata/geodata.R for details about coding

merge m:1 q09a using "prefgeo.dta"
drop _merge

label var mindist "Minimum distance to disputed areas"
label var mindist_std "Minimum distance to disputed areas (standardized)"
label var mindist_nor "Minimum distance to disputed areas (normalized)"

ttest mindist_nor, by(disp_proxim)

bysort disp_proxim: sum mindist_nor

label variable mindist_nor "Distance"
******

//contextual treatments

gen powerful = 0
replace powerful = 1 if inlist(pat, "01", "02", "03", "04", "05", "06")
label variable powerful "Strong Neighbor"

gen valuable = 0
replace valuable = 1 if inlist(pat, "01", "02", "03", "07", "08", "09")
label variable valuable "Valuable"

gen hist_none=0
replace hist_none=1 if inlist(pat, "03", "06", "09", "12")
label variable hist_none "Historically Unoccupied"

gen hist_japan=0
replace hist_japan=1 if inlist(pat, "01", "04", "07", "10")
label variable hist_japan "Historically Japanese"

gen hist_foreign=0
replace hist_foreign=1 if inlist(pat, "02", "05", "08", "11")
label variable hist_foreign "Historically Foreign"

gen io = 0 
replace io = 1 if a03b != .


//sharing sovereignty and right of use
replace a01 = 0 if a01 == 2 
label variable a01 "Sharing"

//Japan sovereignty and right of use
replace a04 = 0 if a04 == 2 
label variable a04 "Japan Exclusive"

//Japan sovereignty and co-development
replace a02 = 0 if a02 == 2 
label variable a02 "Japan Sovereignty Only"

//Sidepayment with IO
replace a03b = 0 if a03b == 2 
label variable a03b "Sidepayment with IO"

//Sidepayment without IO
replace a03a = 0 if a03a == 2
label variable a03a "Sidepayment without IO"


//combining sidepayment
gen a03ab = a03a
replace a03ab = a03b if a03ab == .

label variable a03ab "Sidepayment"



//Policy outcomes

gen q100_1 = 2 - a05a
label variable q100_1 "Publicity"

gen q100_2 = 2 - a06
label variable q100_2 "Sanction"

gen q100_3 = 2 - a07a
label variable q100_3 "Limited Military"

gen q100_4 = 2 - a07b
label variable q100_4 "Full Military"

gen q100_5 = 2 - a08a
label variable q100_5 "Bilateral"

gen q100_6 = 2 - a09a
label variable q100_6 "IO Arbitration"

gen q100_7 = 2 - a10
label variable q100_7 "Shelving"

//hardcore
gen hardcore = 0 
replace hardcore = 1 if a04 == 1 & a01 == 0 & a02 == 0 & a03ab == 0
replace hardcore = . if a04 == 3 & a01 == 3 & a02 == 3 & (a03a == 3 | a03b == 3)
label variable hardcore "Indivisibility"

//softie
gen softie = 0
replace softie = 1 if a04 == 1 & a01 == 1 & a02 == 1 & a03ab == 1
replace softie = . if a04 == 3 & a01 == 3 & a02 == 3 & (a03a == 3 | a03b == 3)


//continuous measure of attitude toward indivisibility

*gen hardcore2=hardcore
*replace hardcore2 = 2 if q103_6 == 1 & q103_1 == 0 & q103_9 == 0 & (q103_10 == 1 | q103_11 == 1)
*replace hardcore2 = 3 if q103_6 == 1 & q103_1 == 0 & q103_9 == 1 & (q103_10 == 1 | q103_11 == 1)
*replace hardcore2 = 4 if q103_6 == 1 & q103_1 == 1 & q103_9 == 1 & (q103_10 == 1 | q103_11 == 1)

*gen hardcore3=0
*replace hardcore3=q103_6*1+q103_12*2+q103_9*3+q103_1*4
*replace hardcore3=. if hardcore3==0

**IRT measure for hardcore
gen a1=a01
gen a2=a02
gen a3=a03ab
gen a4=a04

recode a1-a4 (3=.)

irt 2pl a1-a4, intpoints(5)
estat report, byparm sort(b)
*irtgraph icc, blocation legend(pos(3) col(1) ring(1) size(small)) xlabel(, alt)
*irtgraph tcc, thetalines(-1.96 0 1.96)
predict hardcore4, latent
replace hardcore4=-hardcore4
label variable hardcore4 "Indivisibility"


**attention check

gen check1 = 0
replace check1 = 1 if a05b == 2

gen check2 = 0
replace check2 = 1 if a08b == 3


***Figure 2: Testing H1 with the treatment of historical ownership ("unsure" answers removed)

mean a01 if a01 < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a01 if a01 < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a01 if a01 < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat4 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat5 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat6 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a02 if a02 < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat7 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a02 if a02 < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat8 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a02 if a02 < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat9 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03b if a03b < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat10 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03b if a03b < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat11 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03b if a03b < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat12 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03a if a03a < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat13 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03a if a03a < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat14 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03a if a03a < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat15 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))


matrix t1 = mat1\mat7\mat10\mat13\mat4
matrix rownames t1 = a c d e b

matrix t2 = mat2\mat8\mat11\mat14\mat5
matrix rownames t2 = a c d e b

matrix t3 = mat3\mat9\mat12\mat15\mat6
matrix rownames t3 = a c d e b

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Historically Owned by Japan) m(Oh)) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Historically Owned by Foreign) m(Sh))  ///
 (matrix(t3[.,1]), ci("t3[.,2] t3[.,3]") label(Historically Owned by Neither) m(Th)),  ///
 coeflabel(a = `" "Sharing Sovereignty" "and Right to Use" "' ///
 		   b = `" "Japan has Sovereignty" "and Right to Use" "' ///
           c = `" "Japan has Sovereignty" "but Co-development" "' ///
           d = `" "Side-Payment with IO" "' ///
           e = `" "Side-Payment without IO" "', labsize(vsmall) ) ///
mlabel format(%9.2g) mlabposition(1) legend(row(1) pos(6))  ///
ytitle(Proportion of Accepting the Outcome) vertical scheme(plotplain)
graph export figure2.pdf, replace


**Appendix Figure 1: looking at military strength of the neighboring country

ttest a01 if a01 < 2, by (powerful) 
matrix mat1 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat2 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a04 if a04 < 2, by (powerful) 
matrix mat3 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat4 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a02 if a02 < 2, by (powerful) 
matrix mat5 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat6 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03b if a03b < 2, by (powerful) 
matrix mat7 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat8 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03a if a03a < 2, by (powerful) 
matrix mat9 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat10 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

matrix t1 = mat1\mat5\mat7\mat9\mat3
matrix rownames t1 = a c d e b

matrix t2 = mat2\mat6\mat8\mat10\mat4
matrix rownames t2 = a c d e b

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Militarily Weak) m(Oh) ) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Militarily Strong) m(Sh)),  ///
coeflabel(a = `" "Sharing Sovereignty" "and Right to Use" "' ///
 		   b = `" "Japan has Sovereignty" "and Right to Use" "' ///
           c = `" "Japan has Sovereignty" "but Co-development" "' ///
           d = `" "Side-Payment with IO" "' ///
           e = `" "Side-Payment without IO" "', labsize(vsmall) ) ///
mlabel format(%9.2g) mlabposition(1) legend(row(1) pos(6)) ///
ytitle(Proportion of Accepting the Outcome) vertical scheme(plotplain)

graph export figureA1.pdf, replace


**Appendix Figure 2: looking at value of the territory

ttest a01 if a01 < 2, by (valuable) 
matrix mat1 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat2 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a04 if a04 < 2, by (valuable) 
matrix mat3 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat4 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a02 if a02 < 2, by (valuable) 
matrix mat5 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat6 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03b if a03b < 2, by (valuable) 
matrix mat7 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat8 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03a if a03a < 2, by (valuable) 
matrix mat9 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat10 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

matrix t1 = mat1\mat5\mat7\mat9\mat3
matrix rownames t1 = a c d e b

matrix t2 = mat2\mat6\mat8\mat10\mat4
matrix rownames t2 = a c d e b

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Value Unsure) m(Oh) ) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Valuable) m(Sh)),  ///
 coeflabel(a = `" "Sharing Sovereignty" "and Right to Use" "' ///
 		   b = `" "Japan has Sovereignty" "and Right to Use" "' ///
           c = `" "Japan has Sovereignty" "but Co-development" "' ///
           d = `" "Side-Payment with IO" "' ///
           e = `" "Side-Payment without IO" "', labsize(vsmall) ) ///
mlabel format(%9.2g) mlabposition(1) legend(row(1) pos(6)) ///
ytitle(Proportion of Accepting the Outcome) vertical scheme(plotplain)

graph export figureA2.pdf, replace

//Figure 3: Proportion of Hardcore Indivisible by Contextual Variable

mean hardcore if hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean hardcore if hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean hardcore if hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean hardcore if powerful == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat4 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean hardcore if powerful == 0
matrix mean = e(b)
matrix var = e(V)
matrix mat5 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean hardcore if valuable == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat6 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean hardcore if valuable == 0
matrix mean = e(b)
matrix var = e(V)
matrix mat7 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

matrix t1 = mat1\mat2\mat3\mat4\mat5\mat6\mat7
matrix rownames t1 = a b c d e f g


coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]")),  ///
 coeflabel(a = `" "Historically" "owned" "by Japan" "' ///
 		   b = `" "Historically" "owned" "by Foreign" "' ///
           c = `" "Historically" "owned" "by Neither" "' ///
           d = `" "Strong" "Neighbor" "' ///
           e = `" "Weak" "Neighbor" "'  ///
		   f = `" Valuable "'  ///
		   g = `" "Value" "Unsure" "', labsize(vsmall) ) ///
mlabel format(%9.3g) mlabposition(1)   ///
ytitle(Proportion of Hardcore Respondents) vertical scheme(plotplain)

graph export figure3.pdf, replace

//Figure 4 and Table 9 in Appendix I (abridged Table 1 in main text):

logit q100_5 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_5 > -1
estimates store o5
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat9 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat10 = (t[1,7], t[1,8], t[1,9])
matrix drop t

logit q100_7 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_7 > -1
estimates store o7
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
outtex, lab detail level below title(Dep = `e(depvar)') file(model3) long replace
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat13 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat14 = (t[1,7], t[1,8], t[1,9])

logit q100_1 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_1 > -1
estimates store o1
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
*outtex, detail level below title(Dep = `e(depvar)') file(model3) long replace
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat1 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat2 = (t[1,7], t[1,8], t[1,9])
matrix drop t

logit q100_6 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_6 > -1
estimates store o6
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat11 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat12 = (t[1,7], t[1,8], t[1,9])
matrix drop t

logit q100_2 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_2 > -1
estimates store o2
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat3 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat4 = (t[1,7], t[1,8], t[1,9])
matrix drop t

logit q100_3 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_3 > -1
estimates store o3
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat5 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat6 = (t[1,7], t[1,8], t[1,9])
matrix drop t

logit q100_4 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_4 > -1
estimates store o4
outreg2 using tableA9, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
prchange hardcore, rest(median)
estadd prvalue, x(hardcore=0 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat7 = (t[1,7], t[1,8], t[1,9])
matrix drop t
estadd prvalue, x(hardcore=1 ) rest(grmedian) replace
matrix t = e(_estadd_prvalue)
matrix mat8 = (t[1,7], t[1,8], t[1,9])
matrix drop t


**Table Table 9 in Appendix I (abridged Table 1 in main text)
seeout, lab

**Figure 4

matrix t1 = mat9\mat13\mat1\mat11\mat3\mat5\mat7
matrix rownames t1 = c e a d b f g

matrix t2 = mat10\mat14\mat2\mat12\mat4\mat6\mat8
matrix rownames t2 = c e a d b f g

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Compromise Possible) ) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Territory Indivisible) ),  ///
 coeflabel(a = "Publicity" ///
           b = `" "Economic" "Sanction" "' ///
		   f = `" "Limited" "Military Action" "' ///
		   g = `" "Full" "Military Action" "' ///
           c = `" "Bilateral" "Negotiation" "' ///
           d = `" "IO" "Arbitration" "' ///
           e = `" "Shelving" "the Dispute" "') ///
mlabel format(%9.2g) mlabposition(1) vertical ///
ytitle(Predicted Probability of Support) legend(pos(6) col(2)) scheme(plotplain)
graph export figure4.pdf, replace

//Figure 5: treatment effect by real country

mean a04 if a04 < 2 & hist_japan == 1 & a14x_china == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_foreign == 1 & a14x_china == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_none == 1 & a14x_china == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

matrix t1 = mat1\mat2\mat3
matrix rownames t1 = a b c

mean a04 if a04 < 2 & hist_japan == 1 & a14x_russia == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_foreign == 1 & a14x_russia == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_none == 1 & a14x_russia == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

matrix t2 = mat1\mat2\mat3
matrix rownames t2 = a b c

mean a04 if a04 < 2 & hist_japan == 1 & a14x_southkorea == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_foreign == 1 & a14x_southkorea == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_none == 1 & a14x_southkorea == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

matrix t3 = mat1\mat2\mat3
matrix rownames t3 = a b c

mean a04 if a04 < 2 & hist_japan == 1 & a11 == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_foreign == 1 & a11 == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_none == 1 & a11 == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

matrix t4 = mat1\mat2\mat3
matrix rownames t4 = a b c

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") ), bylabel(China) || ///
		(matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") ), bylabel(Russia) || ///
		(matrix(t3[.,1]), ci("t3[.,2] t3[.,3]") ), bylabel(South Korea) || ///
		(matrix(t4[.,1]), ci("t4[.,2] t4[.,3]") ), bylabel(No Real Country in Mind)  ///
		 coeflabel(a = `" "Historically owned" "by Japan" "' ///
 		b = `" "Historically owned" "by foreign" "' ///
        c = `" "Historically owned" "by neither" "') ///
		mlabel format(%9.2g) mlabposition(1) legend(col(1)) ///
		ytitle(Proportion of Accepting the Indivisible Outcome, size(small)) ///
		vertical scheme(plotplain)
graph export figure5.pdf, replace


//What countries do you have in mind?

**no real country in mind

logit q100_1 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_1 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace

logit q100_2 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_2 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_5 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_5 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_6 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_6 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_7 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_7 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_3 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_3 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_4 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_4 > -1 & a11==1
outreg2 using tableA5, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

**Table 5 in Appendix
seeout, lab


** thinking about China only

logit q100_1 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_1 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace
estimates store a1

logit q100_2 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_2 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store a2

logit q100_5 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_5 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store a3

logit q100_6 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_6 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store a4

logit q100_7 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_7 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store a5

logit q100_3 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_3 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store a6

logit q100_4 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_4 > -1 & a14x_china==1 & dup<2
outreg2 using tableA6, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store a7

**Table 6 in Appendix
seeout, lab


**Thinking about Russia only

logit q100_1 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_1 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace
estimates store b1

logit q100_2 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_2 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store b2

logit q100_5 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_5 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store b3

logit q100_6 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_6 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store b4

logit q100_7 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_7 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store b5

logit q100_3 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_3 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store b6

logit q100_4 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_4 > -1 & a14x_russia==1 & dup<2
outreg2 using tableA7, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store b7

**Table 7 in Appendix
seeout, lab


**Thinking about South Korea only 

logit q100_1 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_1 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace
estimates store c1

logit q100_2 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_2 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store c2

logit q100_5 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_5 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store c3

logit q100_6 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_6 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store c4

logit q100_7 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_7 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store c5

logit q100_3 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_3 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store c6

logit q100_4 hardcore hist_japan hist_foreign nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv if q100_4 > -1 & a14x_southkorea==1 & dup<2
outreg2 using tableA8, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append
estimates store c7

**Table 8 in Appendix
seeout, lab


**Figure 6 in main text
**only plotting coefficient of indivisibility	  
coefplot (a5, label(Senkaku/Diaoyu Islands Dispute with China) m(Oh)) /// 
		(b5, label(Northern Territories/Kurile Islands Dispute with Russia) m(Sh)) ///
		(c5, label(Takeshima/Dokdo Islands Dispute with South Korea) m(Th)), bylabel(Shelving the Dispute) ///
      || a3 b3 c3, bylabel(Bilateral Negotiation) ///
	  || a1 b1 c1, bylabel(Publicity) ///
	  || a4 b4 c4, bylabel(IO Arbitration) ///
	  || a2 b2 c2, bylabel(Economic Sanction) ///
	  || a6 b6 c6, bylabel(Limited Military) ///
	  || a7 b7 c7, bylabel(Full Military) ///
	  ||, keep(hardcore) xline(0) legend(col(1) pos(6)) xlabel(-15(5)5) xscale(range(-15(5)5)) scheme(plotplain)

graph export figure6.pdf, replace


// Testing H1 with the treatment of historical ownership ("unsure" combined with "unacceptable)

**Appendix Figure 3： Historical ownership treatment

preserve
recode a01 a02 a03a a03b a04 (3 = 0)
mean a01 if a01 < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat1 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a01 if a01 < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat2 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a01 if a01 < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat3 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat4 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat5 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a04 if a04 < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat6 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a02 if a02 < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat7 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a02 if a02 < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat8 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a02 if a02 < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat9 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03b if a03b < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat10 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03b if a03b < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat11 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03b if a03b < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat12 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03a if a03a < 2 & hist_japan == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat13 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03a if a03a < 2 & hist_foreign == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat14 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))

mean a03a if a03a < 2 & hist_none == 1
matrix mean = e(b)
matrix var = e(V)
matrix mat15 = (mean[1,1], mean[1,1]-1.96*(sqrt(var[1,1])), mean[1,1]+1.96*(sqrt(var[1,1])))


matrix t1 = mat1\mat7\mat10\mat13\mat4
matrix rownames t1 = a c d e b

matrix t2 = mat2\mat8\mat11\mat14\mat5
matrix rownames t2 = a c d e b

matrix t3 = mat3\mat9\mat12\mat15\mat6
matrix rownames t3 = a c d e b

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Historically Owned by Japan) m(Oh)) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Historically Owned by Foreign) m(Sh))  ///
 (matrix(t3[.,1]), ci("t3[.,2] t3[.,3]") label(Historically Owned by Neither) m(Th)),  ///
 coeflabel(a = `" "Sharing Sovereignty" "and Right to Use" "' ///
 		   b = `" "Japan has Sovereignty" "and Right to Use" "' ///
           c = `" "Japan has Sovereignty" "but Co-development" "' ///
           d = `" "Side-Payment with IO" "' ///
           e = `" "Side-Payment without IO" "', labsize(vsmall) ) ///
mlabel format(%9.2g) mlabposition(1) legend(row(1) pos(6))  ///
ytitle(Proportion of Accepting the Outcome) vertical scheme(plotplain)
graph export figureA3.pdf, replace
restore

**Appendix Figure 4: looking at military strength of the neighboring country

preserve
recode a01 a02 a03a a03b a04 (3 = 0)

ttest a01 if a01 < 2, by (powerful) 
matrix mat1 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat2 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a04 if a04 < 2, by (powerful) 
matrix mat3 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat4 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a02 if a02 < 2, by (powerful) 
matrix mat5 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat6 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03b if a03b < 2, by (powerful) 
matrix mat7 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat8 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03a if a03a < 2, by (powerful) 
matrix mat9 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat10 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

matrix t1 = mat1\mat5\mat7\mat9\mat3
matrix rownames t1 = a c d e b

matrix t2 = mat2\mat6\mat8\mat10\mat4
matrix rownames t2 = a c d e b

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Militarily Weak) m(Oh) ) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Militarily Strong) m(Sh)),  ///
coeflabel(a = `" "Sharing Sovereignty" "and Right to Use" "' ///
 		   b = `" "Japan has Sovereignty" "and Right to Use" "' ///
           c = `" "Japan has Sovereignty" "but Co-development" "' ///
           d = `" "Side-Payment with IO" "' ///
           e = `" "Side-Payment without IO" "', labsize(vsmall) ) ///
mlabel format(%9.2g) mlabposition(1) legend(row(1) pos(6)) ///
ytitle(Proportion of Accepting the Outcome) vertical scheme(plotplain)

graph export figureA4.pdf, replace
restore

**Appendix Figure 5: looking at value of the territory

preserve
recode a01 a02 a03a a03b a04 (3 = 0)

ttest a01 if a01 < 2, by (valuable) 
matrix mat1 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat2 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a04 if a04 < 2, by (valuable) 
matrix mat3 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat4 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a02 if a02 < 2, by (valuable) 
matrix mat5 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat6 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03b if a03b < 2, by (valuable) 
matrix mat7 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat8 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

ttest a03a if a03a < 2, by (valuable) 
matrix mat9 = (r(mu_1), r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1))), r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1))))
matrix mat10 = (r(mu_2), r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2))), r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2))))

matrix t1 = mat1\mat5\mat7\mat9\mat3
matrix rownames t1 = a c d e b

matrix t2 = mat2\mat6\mat8\mat10\mat4
matrix rownames t2 = a c d e b

coefplot (matrix(t1[.,1]), ci("t1[.,2] t1[.,3]") label(Value Unsure) m(Oh) ) ///
 (matrix(t2[.,1]), ci("t2[.,2] t2[.,3]") label(Valuable) m(Sh)),  ///
 coeflabel(a = `" "Sharing Sovereignty" "and Right to Use" "' ///
 		   b = `" "Japan has Sovereignty" "and Right to Use" "' ///
           c = `" "Japan has Sovereignty" "but Co-development" "' ///
           d = `" "Side-Payment with IO" "' ///
           e = `" "Side-Payment without IO" "', labsize(vsmall) ) ///
mlabel format(%9.2g) mlabposition(1) legend(row(1) pos(6)) ///
ytitle(Proportion of Accepting the Outcome) vertical scheme(plotplain)

graph export figureA5.pdf, replace
restore			
			
			
//Appendix Table 3:  Using the IRT Measure of Indivisibility

logit q100_1 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_1 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace

logit q100_2 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_5 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_5 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_7 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_6 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_6 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_7 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_2 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_3 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_3 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_4 hardcore4 hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv  if q100_4 > -1
outreg2 using tableA3, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

seeout, lab
			
			
//Appendix Table 4:  Using the Geographical Proximity Control

logit q100_1 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor if q100_1 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) replace

logit q100_2 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor  if q100_5 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_5 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor  if q100_7 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_6 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor  if q100_6 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_7 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor  if q100_2 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_3 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor  if q100_3 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

logit q100_4 hardcore hist_japan hist_foreign nationalism powerful valuable age male college fulltime parttime income socialstatus news defense ldp noparty conserv mindist_nor  if q100_4 > -1
outreg2 using tableA4, lab excel tex 2aster addstat(Pseudo R-squared, `e(r2_p)', LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) append

seeout, lab

//Appendix Table 1

tabstat hardcore hardcore4 nationalism1-nationalism5 nationalism age male college fulltime parttime income socialstatus news defense ldp noparty conserv,  stat(n mean median sd min max) format(%9.2f) col(stat) long



***END***				
			
			
			
			
			
			
	